<?php

namespace app\controller;

use think\facade\Db;
use think\facade\Request;

class ProductSolutionController
{
    /**
     * 获取产品方案标题
     * @return \think\response\Json
     */
    public function getProductSolutionTitle()
    {
        $title = Db::table('product_solution_title')->find();
        return json($title);
    }

    /**
     * 保存产品方案标题
     * @return \think\response\Json
     */
    public function saveProductSolutionTitle()
    {
        $data = Request::post();
        if (isset($data['id'])) {
            Db::table('product_solution_title')->where('id', $data['id'])->update($data);
        } else {
            Db::table('product_solution_title')->insert($data);
        }
        return json(['code' => 200, 'msg' => '保存成功']);
    }

    // 其他产品方案相关接口方法...
}
